home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
macintosh-c
/
macc-carbon-demos-nonbinhex.sit
/
macc-carbon-demos-nonbinhex
/
chap18-demo-classic events
/
ChooseAFolderDialog.c
< prev
next >
Wrap
Text File
|
2001-05-30
|
2KB
|
54 lines
// *******************************************************************************************
// ChooseAFolderDialog.c
// *******************************************************************************************
// ………………………………………………………………………………………………………………………………………………………………………………………………………………………… includes
#include "Files.h"
// …………………………………………………………………………………………………………………………………………………………………………………………………… global variables
extern NavEventUPP gGetFilePutFileEventFunctionUPP ;
extern NavDialogRef gModalToApplicationNavDialogRef;
// ********************************************************************* doChooseAFolderDialog
OSErr doChooseAFolderDialog(void)
{
OSErr osError = noErr;
NavDialogCreationOptions dialogOptions;
WindowRef windowRef, parentWindowRef;
Str255 message;
osError = NavGetDefaultDialogCreationOptions(&dialogOptions);
if(osError == noErr)
{
if((osError = GetSheetWindowParent(FrontWindow(),&parentWindowRef)) == noErr)
windowRef = parentWindowRef;
else
windowRef = FrontWindow();
GetIndString(message,rMiscStrings,sChooseAFolder);
dialogOptions.message = CFStringCreateWithPascalString(NULL,message,
CFStringGetSystemEncoding());
dialogOptions.modality = kWindowModalityAppModal;
osError = NavCreateChooseFolderDialog(&dialogOptions,gGetFilePutFileEventFunctionUPP ,
NULL,windowRef,&gModalToApplicationNavDialogRef);
if(osError == noErr && gModalToApplicationNavDialogRef != NULL)
{
osError = NavDialogRun(gModalToApplicationNavDialogRef);
if(osError != noErr)
{
NavDialogDispose(gModalToApplicationNavDialogRef);
gModalToApplicationNavDialogRef = NULL;
}
}
}
return osError;
}
// *******************************************************************************************